Socket
Socket
Sign inDemoInstall

@os-design/theming

Package Overview
Dependencies
80
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @os-design/theming

Before you start using the os-design components, you need to add the ThemeProvider that will apply the theme to all the components used.


Version published
Weekly downloads
9
increased by200%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@os-design/theming NPM version BundlePhobia

Before you start using the os-design components, you need to add the ThemeProvider that will apply the theme to all the components used.

Installation

Step 1. Install the package

Install the package using the following command:

yarn add @os-design/theming

Also make sure that you have the @emotion/react package installed.

Step 2. Redefine the emotion theme

Create the emotion.d.ts file with the following content:

import '@emotion/react';
import { Theme as BaseTheme } from '@os-design/theming';

declare module '@emotion/react' {
  // eslint-disable-next-line @typescript-eslint/no-empty-interface
  export interface Theme extends BaseTheme {}
}

Step 3. Wrap your app in ThemeProvider

For example:

import React from 'react';
import { ThemeProvider } from '@os-design/theming';
import AppRouter from './AppRouter';

const App: React.FC = () => (
  <ThemeProvider>
    <AppRouter />
  </ThemeProvider>
);

export default App;

See all theming features in the Storybook.

FAQs

Last updated on 26 May 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc